package com.bestcem.xm.user.util.convert;

import com.bestcem.xm.user.controller.vo.PageUserResponseVO;
import com.bestcem.xm.user.controller.vo.role.RolePermissionVO;
import com.bestcem.xm.user.controller.vo.user.*;
import com.bestcem.xm.user.controller.vo.user.request.*;
import com.bestcem.xm.user.entity.mysql.User;
import com.bestcem.xm.user.entity.pojo.UserAccountListDO;
import com.bestcem.xm.user.entity.pojo.UserDO;
import com.bestcem.xm.user.service.dto.PageUserResponseDTO;
import com.bestcem.xm.user.service.dto.role.RolePermissionDTO;
import com.bestcem.xm.user.service.dto.user.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * 用户转换类
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/03/04 10:00
 */
@Mapper(componentModel = "spring")
public interface UserConvert {
    UserDO dto2Do(UserDTO dto);

    List<UserDTO> dos2Dtos(List<UserDO> userDOS);

    User do2Mysql(UserDO userDO);

    List<UserDO> mysqls2Dos(List<User> selectBySelective);

    UserDO mysql2Do(User user);

    List<UserAccountListVO> accountDTO2VO(List<UserAccountListDO> userAccountList);

    UserDTO mysqlToDto(User user);

    UserDTO do2Dto(UserDO userDO);

    User dto2Mysql(UserDTO dto);

    UserAccountVO dtoToVo(UserDTO data);

    List<UserAccountVO> dtos2AccountVos(List<UserDTO> userDtos);

    UserWxLoginVO wxLoginDTO2VO(WxLoginDTO data);

    WxRegisterDTO wxMiniRegisterVO2Dto(WxMiniRegisterVO wxMiniRegisterVO);

    WxOffiRegisterDTO wxOffiRegisterVO2Dto(WxOffiRegisterVO wxOffiRegisterVO);

    WxAuthViewVO wxAuthViewDTO2VO(WxAuthViewDTO data);

    WxTokenViewVO wxTokenViewDTO2VO(WxTokenViewDTO data);

    WeChatCodeResultVO wechatCodeTokenDTO2CVO(WeChatCodeResultDTO data);

    WxAuthViewRequestDTO wxAuthViewVO2DTO(WxAuthViewRequestVO requestVO);

    WxTokenViewRequestDTO wxTokenViewVO2DTO(WxTokenViewRequestVO requestVO);

    WeChatTokenDTO wechatTokenVO2DTO(WeChatTokenRequestVO requestVO);

    WeChatCodeTokenDTO wechatCodeTokenVO2DTO(WeChatCodeTokenVO tokenVO);

    UserSelfVO userSelfDTO2VO(UserSelfDTO data);

    List<TicketUserVO> ticketUserDTOtoVO(List<TicketUserDTO> ticketUserDTOs);

    List<WxSwitchVO> wxSwitchDTOList2VO(List<WxSwitchDTO> data);

    WxAuthViewV2RequestDTO wxAuthViewV2RequestVO2DTO(WxAuthViewV2RequestVO requestVO);

    WxFastOrgLoginDTO wxFastOrgLoginVO2DTO(WxFastOrgLoginRequestVO requestVO);

    @Mapping(source = "clickFlag", target = "clickFlag", ignore = true)
    @Mapping(source = "submitFlag", target = "submitFlag", ignore = true)
    @Mapping(source = "commonFlag", target = "commonFlag", ignore = true)
    @Mapping(source = "commonFlag", target = "blurFlag", ignore = true)
    UserBookingTrackDTO bookingTrackVO2DTO(CreateBookingTracksVO createBookingTracksVO);

    List<UserAccountListDTO> accountDO2DTO(List<UserAccountListDO> userAccountList);

    PageUserResponseVO accountPageDTO2VO(PageUserResponseDTO responseDTO);

    List<ExportUserAccountDTO> userAccount2Export(List<UserAccountListDTO> data);

    RolePermissionVO permissionDTO2VO(RolePermissionDTO data);

    WxLoginDTO needMfa2WxLoginDTO(JudgeNeedMfaLoginDTO data);
}
